import { EventTarget } from "cc";
export type EventCallBack = (...args:any[]) => void

export default class EventMgr{

    protected eventTarget:EventTarget = new EventTarget();

    on(eventType:string,cb:EventCallBack,target?:any):void{
        this.eventTarget.on(eventType,cb,target);
    }

    
    off(eventType:string,cb:EventCallBack,target?:any):void{
        this.eventTarget.off(eventType,cb,target);
    }

    emmit(eventType:string,...args:any[]):void{
        this.eventTarget.emit(eventType,...args);
    }
}